<?php
/**
 *  Form_Element Interface
 *  A Form_Element has a value which must be a string?
 *
 */
interface Yz_Form_Element_Interface
{

    /**
     *  Also a getter may be used: x = $element->errorCode
     *
     */
    public function getException();
    /**
     *  Also a getter may be used: x = $element->value
     *
     */
    public function getName();
    /**
     *  Also a getter may be used: x = $element->value
     *
     */
    public function getValue();
    /**
     *  Also a setter may be used: $element->value = x
     *
     */
    public function setValue($value);

    /**
     *  @param Yz_Template_Interface $template
     *  @return string|null
     *  If null, the element will not appear in form at all (eg. when a table is the form's container, no row will be reserved for this element, etc)
     */
    public function render(Yz_Template_Interface $template);

    /**
     *  @return ?
     *  @throw Yz_Form_Element_Exception
     */
    public function parse(Yz_Hash $values);
}
